static int
install_extension (const char *bundle,
- gboolean force)
+ gboolean force,
+ gboolean print_uuid)
{
g_autoptr (AutoarExtractor) extractor = NULL;
g_autoptr (JsonObject) metadata = NULL;
goto err;
}
+ if (print_uuid)
+ g_print ("%s\n", uuid);
+
return 0;
err:
g_autoptr (GError) error = NULL;
g_auto (GStrv) filenames = NULL;
gboolean force = FALSE;
+ gboolean print_uuid = FALSE;
GOptionEntry entries[] = {
{ .long_name = "force", .short_name = 'f',
.arg = G_OPTION_ARG_NONE, .arg_data = &force,
.description = _("Overwrite an existing extension") },
+ { .long_name = "print-uuid",
+ .arg = G_OPTION_ARG_NONE, .arg_data = &print_uuid,
+ .description = _("Print extension UUID on success") },
{ .long_name = G_OPTION_REMAINING,
.arg_description =_("EXTENSION_BUNDLE"),
.arg = G_OPTION_ARG_FILENAME_ARRAY, .arg_data = &filenames },
return 1;
}
- return install_extension (*filenames, force);
+ return install_extension (*filenames, force, print_uuid);
}